<?php
namespace Common\Model;

use Think\Model;

class InformModel extends Model
{

    //写入通知
    public function addMessage($data)
    {

        if($this->add($data)){
            return true;
        }else{
            return false;
        }
    }
    //查询通知信息
    public function messageList($id=''){
        if(empty($id)){
            $counts=$this->count();
            $page=page($counts,10,5);
            $list=$this->alias("a")->field("a.*,b.order_number")->join("sr_orders as b  on a.rid=b.rid")
                 ->order("id desc")->limit($page->firstRow, $page->listRows)->select();
            $arr['list']=$list;
            $arr['page']=$page;
            return $arr;
        }
    }
}